package com.cals;

import java.util.Scanner;

/*
输入四位数，判断是否对称
*/
public class Demo6 {
    public static void main(String[] args) {
        //扫描器
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入四位数，用来判断是否对称：");
        //输入数字给number
        int number = sc.nextInt();
        //获得个位数
        int ge = number % 10;
        //获得十位数
        int shi = (number / 10) % 10;
        //获得百位数
        int bai = (number / 100) % 10;
        //获得千位数
        int qian = (number / 1000) % 10;
        //判断是否对称
        if (ge == qian && shi == bai) {
            System.out.println(number + "是对称数字！");
        } else {
            System.out.println(number + "不是对称数字！");
        }
    }
}
